//所有路由的配置都放在这里

//1.引入
import  {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'
import Home from "../components/Home.vue";
import Mine from "../components/Mine.vue";
import User from "../components/User.vue";


//2.创建路由对象
const routes = [
  //  路由重定向:当路由匹配到 `/` 时候,会重定向到 `/home` 上
  {path: '/', redirect: '/home'},
  {path: '/home',component:Home},
  {path: '/mine',component:Mine},
  //{path: '/user/:id',component:User},
  {path: '/user/001',component:User},
]

const router = createRouter({
  history: createWebHistory(),
  routes: routes,
});

// 导出路由对象
export default router























